package com.persondemo.videoappliction.ui.adapter;

import android.content.Context;
import android.content.Intent;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.persondemo.videoappliction.R;
import com.persondemo.videoappliction.bean.MainBean;
import com.persondemo.videoappliction.ui.video.VideoDetilsActivity;
import com.persondemo.videoappliction.utils.ImageLoaderUtil;

import java.util.List;

/**
 * Created by Administrator on 2018/3/26.
 */

public class AnimeAdapter extends BaseQuickAdapter<MainBean.DataBean.DmlistBean, BaseViewHolder> {
    private Context mContext;

    public AnimeAdapter(@Nullable List<MainBean.DataBean.DmlistBean> data, Context mContext) {
        super(R.layout.module_include_recycle, data);
        this.mContext = mContext;
    }

    @Override
    protected void convert(BaseViewHolder helper, MainBean.DataBean.DmlistBean item) {
        ImageLoaderUtil.LoadImage(mContext, item.getImgs(), (ImageView) helper.getView(R.id.recler_base_img));
        helper.setText(R.id.recler_base_name, item.getName());
//        if (item.getJishu().length() < 5) {
            helper.setText(R.id.recler_base_text, item.getJishu());
//        } else {
//            String title = item.getJishu().substring(0, 6);
//            helper.setText(R.id.recler_base_text, title);
//        }
    }
}
